package com.gobuy.goods.dao;

import com.gobuy.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author Gaozexi on 2020/6/3 19:11
 * Step by Step  and Stand on,  You Are The Best Investment!
 */
public interface SpecMapper extends Mapper<Spec> {

    @Select("SELECT s.* FROM tb_spec s WHERE s.`template_id` IN(SELECT c.template_id FROM " +
            "tb_category c WHERE c.`name` =#{categoryName})")
    List<Map> findSpecListByCategoryName(@Param("categoryName") String categoryName);

}
